<template>
  <div class="app-container">
    <el-table
      :data="data"
      style="width: 100%;margin-bottom: 20px;"
      row-key="id"
      border
      default-expand-all
      :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
    >
      <!-- <el-table-column prop="id" label="序号" width='80' align='center'/> -->
      <el-table-column label="发送对象" align='center'>
        <template slot-scope="item">
          <span>{{item.row.type==1?'个人':'企业'}}</span>
        </template>
      </el-table-column>
      <el-table-column label="用户动作" align='center'>
        <template slot-scope="item">
          <span>{{getAction(item.row.action)}}</span>
        </template>
      </el-table-column>
      <el-table-column label="标题" prop="title" align='center'/>
      <el-table-column label="消息内容" prop="content" align='center'/>
      <el-table-column prop="update_time" label="更新时间" align='center'/>
      <el-table-column label="操作" width='160' align='center'>
        <template slot-scope="item">
          <el-link type="primary" class="table_btn" @click="handleUpdate(item.row)" :underline="false"><i class="iconfont icon-bianji"></i>编辑</el-link>
        </template>
      </el-table-column>
    </el-table>
    <el-pagination
      background
      class="pagination-container"
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page="paginate.current"
      :hide-on-single-page='isHideSingle'
      :page-sizes="paginate.sizes"
      :page-size="paginate.limit"
      :layout="paginate.layout"
      :total="paginate.total"/>
    <el-dialog :visible.sync="formVisible" width="516px" @close="handleCancel" :show-close='false'>
      <div slot="title" class="dialog-title">编辑消息</div>
      <el-form :ref="formName" label-width='100px' :model="formFieldsData" :rules="rules" :label-position="labelPosition">
        <el-form-item label="消息内容：" prop='content'>
          <el-input v-model="formFieldsData.content" type='textarea' style="width: 92%" autocomplete="off" clearable placeholder='请输入消息内容'/>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="handleCancel" size='medium'>取 消</el-button>
        <el-button type="primary" @click="handleSubmit" size='medium'>确 定</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import formOperate from '@/layout/mixin/formOperate'

export default {
  name: 'Index',
  mixins: [formOperate],
  data() {
    return {
      url:'/MessageTemp',
      id:'',
      formFieldsData:{
        content:''
      },
      // 验证规则
      rules: {
        content: [
          { required: true, message: '请输入菜单名称', trigger: 'blur' }
        ]
      },
      formName:'message',
      actions:[
        {label:'简历通过',value:'1'},
        {label:'简历拒绝',value:'2'},
        {label:'简历被查看',value:'3'},
        {label:'企业认证通过',value:'4'},
        {label:'企业认证拒绝',value:'5'},
        {label:'职位通过',value:'6'},
        {label:'职位拒绝',value:'7'},
        {label:'收到投递的简历',value:'8'}
      ]
    }
  },
  mounted() {
    
  },
  methods: {
    getAction(action) {
      return this.actions[action-1].label
    }
  }
}
</script>
<style>
  .details .el-dialog__body{
    height: 700px;
    overflow-y: auto;
  }
</style>
<style lang="scss" scoped>
  .backUp{
    flex:1;
    min-width: 0;
    text-align: left;
    margin-bottom:10px;
  }
  .title{
    font-size: 16px;
    margin-bottom:10px;
  }
  .info{
    line-height: 30px;
  }
  .img_box{
    text-align: center;
  }
  .job_list{
    border:1px solid #eee;
    padding: 10px;
    border-radius: 4px;
  }
  .more{
    margin-right: 10px;
  }
</style>